home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 21
/
Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso
/
Aminet
/
game
/
patch
/
DdlbugHD.lha
/
Doodlebug
/
src
/
dbhd
/
DoodleBugHD.asm
< prev
next >
Wrap
Assembly Source File
|
1997-07-24
|
3KB
|
165 lines
; *** Doodlebug HD Loader V1.0
; *** Written by Keith Krellwitz (kkrellwi@nmu.edu)
blocksize = $200
MACHINE 68000
include "/lib/libs.i"
include "/lib/macros.i"
include "/lib/refs.i"
; ** now I prefer putting HD_PARAMS here
; ** (for a future extension: possible JOTDLoad similar to WHDLoad)
HD_PARAMS "dbug.d","CON:20/20/350/200/Doodlebug HD Loader/AUTO",STD_DISK_SIZE,1
_loader:
move.l d0,trainer
Mac_printf "Doodlebug HD Loader & fix v1.1"
Mac_printf "Programmed by Keith Krellwitz (Abaddon) ©1997"
Mac_printf "AGA-Fix by Jean-François Fabre"
tst.l D0
beq notrain
NEWLINE
Mac_printf "Trainer activated"
notrain:
JSRABS LoadDisks
JSRABS TransfRoutines
move.l #CACRF_CopyBack,D1
moveq.l #0,D0
JSRABS Degrade
GO_SUPERVISOR
SAVE_OSDATA $80000
; move.w #$4E75,$C0 ; for a future breakpoint
GETUSRADDR BootGame
move.l D0,A0
jmp (A0) ; now we'll be in relocated section
_UserPatchRoutines:
BootGame:
LEA $00000400,A7
MOVE.W #$7FFF,$00DFF09A
MOVE.W #$7FFF,$00DFF09C
MOVE.W #$7FFF,$00DFF096
MOVE #$2100,SR
lea $400,a0
move.l #$16,d1 ;<--track offset of main in image
move.l #$b9,d2 ;<--length of main
moveq.l #0,D0
JSRGEN ReadRobSectorsFast
bsr patloader
JSRGEN FlushCachesHard
JSRGEN ResetSprites
move.l #$fff,$dff180
jmp $400.W
patloader:
PATCHUSRJMP $54e,rmain
JSRGEN FlushCachesHard ; don't forget to flush caches
rts
rmain:
bsr patmain
move.l #$5c4e75,-(a7)
move.l #$204fef,-(a7)
move.l #$4cef7fff,-(a7)
move.l #$538166fa,-(a7)
move.l #$66fa4219,-(a7)
move.l #$12d85380,-(a7)
move.l #$2549005c,-(a7)
move.l #$45fafffe,-(a7)
JSRGEN FlushCachesHard ; again ;-)
jmp (a7)
patmain:
; JSR $C0 ; if I want to break here...
STORE_REGS ; macro does it
; movem.l d0-d7/a0-a6,-(a7)
; patch loader
PATCHGENJSR $2dccc,ReadRobSectorsFast ; actually it's RN routine
; (Core games always use RN routines)
move.l #$4cdf3ffe,$2dcd2
move.w #$4e75,$2dcd6
; patch protection
lea $46352,a0
move.l #$23fc35b2,(a0)+
move.l #$30680000,(a0)+
move.w #$c68a,(a0)
move.l #$460de,$698.W
move.l #$35b23068,$100.W
;patch quit
PATCHUSRJSR $8a38,KbInt
move.w #$4e71,$8a3e
; patch drive LED
move.w #$600E,$883C
; insert blitter waits
; to avoid gfx bugs
PATCHGENJSR $1BE7E,WaitBlit
PATCHGENJSR $21140,WaitBlit
PATCHGENJSR $2192E,WaitBlit
PATCHGENJSR $21C8A,WaitBlit
PATCHGENJSR $21EC2,WaitBlit
PATCHGENJMP $2B9E2,WaitBlit
PATCHGENJMP $2BA2A,WaitBlit
PATCHUSRJSR $28D5E,BlitAndWait
PATCHUSRJSR $28D6E,BlitAndWait
PATCHUSRJSR $28D7E,BlitAndWait
PATCHUSRJSR $28D8E,BlitAndWait
PATCHUSRJSR $28DAA,BlitAndWait
PATCHUSRJSR $28DBE,BlitAndWait
PATCHUSRJSR $28DD2,BlitAndWait
PATCHUSRJSR $28DE6,BlitAndWait ; if more, do automatic search
;patch trainer
move.l trainer(pc),D0 ;for relocatability
beq notrainer
move.b #$46,$2b323
move.l #$60220024,$2b328
notrainer:
JSRGEN FlushCachesHard
; movem.l (a7)+,d0-d7/a0-a6
RESTORE_REGS ; use the macros, it's easier
rts
; actually wait and blit (better)
BlitAndWait:
JSRGEN WaitBlit
move.w D5,($DFF058) ; do the blit
rts
KbInt:
movem.l d0,-(a7)
bset #$0,$bfee01
not.b d0
ror.b #$1,d0
cmp.b #$58,d0 ; f9
bne noquit
JSRGEN InGameExit
noquit:
movem.l (a7)+,d0
rts
trainer:
dc.l 0
_general_pbuffer
dc.l 0
_user_pbuffer
dc.l 0
_EndUserPatchRoutines: